package com.lcs.springcloud.controller;

import com.lcs.springcloud.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    StockService stockService;

    @Value("${server.port}")
    String port;

    @RequestMapping("/reduct")
    public String reduct(@RequestParam(value = "product_id") String product_id){
        return stockService.updateStock(product_id);
    }

}
